<?php
$this->headTitle('Danh mục tin tức','append');
?>
<div class="dashboard-menu dashboard-admin">
    <span class="back">&nbsp;</span>
    <h1>Danh mục tin</h1>

        <?php if($this->acl->checkAllowed(array('moduleName'=>'admin','controllerName'=>'newscat','actionName'=>'add'))){ ?>
            <a class="btn btn-danger" href="<?php echo $this->url(array('module'=>'admin', 'controller'=>'newscat', 'action'=>'add'));?>">
                Thêm mới
            </a>
        <?php } ?>                        
</div>
<div class="row placeholders">
    <div class="col-md-12">
        <div class="widget-big">
            <div class="table table-responsive">
                <div class="search-result">
                    <table class="table table-bordetext-danger table-striped table-condensed table-hover" border="0" cellspacing="0" cellpadding="0">
                        <thead>
                            <tr class="warning">
                                <th style="width:10%;">Mã</th>
                                <th style="width:10%;">Mã chữ</th>
                                <th style="width:50%;">Tên BĐS</th>
                                <th style="width:10%;">STT</th>
                                <th style="width:10%;">Hiển thị</th>
                                <th style="width:10%;">Chức năng</th>                                
                            </tr>
                        </thead>
                        <tbody>
                        <?php
                            foreach ($this->newsCatList as $newscat){
                        ?>
                            <tr>
                                <td style="width:10%;" class="text-left"><?=$newscat['catId'];?></td>
                                <td style="width:10%;" class="text-left"><?=$newscat['catCode'];?></td>
                                <td style="width:50%;" class="text-left">
                                    <?php if($this->acl->checkAllowed($this->auth,'admin','newscat','edit')){ ?>
                                        <a href="<?php echo $this->url(array('module'=>'admin', 'controller'=>'newscat', 'action'=>'edit', 'newsCatId'=>$newscat['catId']));?>" title="Sửa thông tin danh mục">
                                            <?php echo $newscat['catName']; ?>
                                        </a>
                                    <?php }else{ ?>
                                        <span class="blue"><?php echo $newscat['catName']; ?></span>
                                    <?php } ?>
                                </td>                                
                                <td style="width:10%;" class="text-left"><?=$newscat['ord'];?></td>
                                <td style="width:10%;">
                                    <?php
                                        if($newscat['display'] == 1){
                                            echo '<span class="active glyphicon glyphicon-ok" title="Enable"></span>';
                                        }else{
                                            echo '<span class="active glyphicon glyphicon-minus" title="Disable"></span>';
                                        }
                                    ?>
                                </td>                                                                                                                               
                                <td style="width:10%;" class="text-left">
                                <?php if($this->acl->checkAllowed(array('moduleName'=>'admin','controllerName'=>'newscat','actionName'=>'edit'))) ?>                                    
                                    <a class="glyphicon glyphicon-pencil" href="<?=$this->url(array('module'=>'admin', 'controller'=>'newscat', 'action'=>'edit', 'newsCatId'=>$newscat['catId']))?>" title="Sửa thông tin danh mục"></a>
                                    &nbsp;&nbsp;                                    
                                <?php if($this->acl->checkAllowed(array('moduleName'=>'admin','controllerName'=>'newscat','actionName'=>'delete'))) ?>                                    
                                    <a class="glyphicon glyphicon-remove" href="<?=$this->url(array('module'=>'admin', 'controller'=>'newscat', 'action'=>'delete', 'newsCatId'=>$newscat['catId']))?>" title="Xoá danh mục"></a>                                    
                                </td>
                            </tr>
                        <?php
                            } 
                        ?>
                        </tbody>
                    </table>
                </div>
            </div>
            <div class="clearfix"></div>
        </div>
    </div>
</div>